<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import ="com.dish.bean.Users,java.util.*,java.io.IOException
,java.sql.Connection
,java.sql.PreparedStatement
,java.sql.ResultSet
,java.sql.SQLException
,java.util.ArrayList

,javax.servlet.ServletException
,javax.servlet.annotation.WebServlet
,javax.servlet.http.HttpServlet
,javax.servlet.http.HttpServletRequest
,javax.servlet.http.HttpServletResponse

,com.dish.bean.Users
,com.dish.dao.UserDAO
,com.dish.dao.UserDAOImpl
,com.dish.utils.JDBCUtils
,java.io.IOException
,javax.servlet.ServletException
,javax.servlet.annotation.WebServlet
,javax.servlet.http.HttpServlet
,javax.servlet.http.HttpServletRequest
,javax.servlet.http.HttpServletResponse
" %>  
<%  
   request.setCharacterEncoding("utf-8");  
   String id = request.getParameter("id");  
   Connection conn = null;
   PreparedStatement ps =null;
   ResultSet rs = null;
   try {
		
		conn = JDBCUtils.getConnection();
		
		String sql = "delete from users where userid=?";
		ps = conn.prepareStatement(sql);
		ps.setInt(1, Integer.parseInt(id));
		int fuck = ps.executeUpdate();
		RequestDispatcher rd = null;
		rd = request.getRequestDispatcher("/ShowUsers");
		rd.forward(request, response);
		
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}finally {
		JDBCUtils.free(rs, ps, conn);
	}
%>  